home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / fortran / libry51.zip / LIBRY2.DOC < prev    next >
Text File  |  1989-11-10  |  14KB  |  386 lines

  1. .pa
  2.                       GENERAL UTILITIES AND CRT CONTROL
  3.  
  4. These general utilities should work on whatever system you have (as long as it
  5. is  basically IBM compatible or an HP-1000).  However,  all of the CRT control
  6. procedures will only work on PCs (80 column mode only), HP-26XXs, or Tektronix
  7. 4XXX terminals.
  8.  
  9.  
  10.             QUICK LIST OF GENERAL UTILITIES AND CRT CONTROL
  11.  
  12. ADATE.... fetch the date
  13. ATIME.... fetch the time of day
  14. BEEP..... beep
  15. CLEAR1... clear one line on the CRT and move cursor to column 1
  16. CPU...... fetch the time (also see SECNDS)
  17. CRT1C.... write one character to the CRT
  18. CRT1D.... write one dot to the CRT in graphics mode
  19. ERASE.... clear the CRT
  20. EXEPRG... run a program from within another program
  21. FFPRN.... send a formfeed to the printer
  22. FTIME.... fetch character string indicating date and time
  23. GET1C.... read 1 character from the keyboard don't wait or display
  24. GETPSP... get the program segment prefix (PC only - on HP use GETST)
  25. HELPME... list help information from user-defined help file
  26. IFBRK.... detect keyboard interrupt (if-break)
  27. LXXX87... logical test for math coprocessor
  28. PAUSE.... display message and wait for any keystroke
  29. PRT1C.... send 1 character to the printer
  30. READ1.... read 1 character from the keyboard - don't wait for RETURN
  31. READC.... read a string from the keyboard
  32. RRPAR.... get file name from runtime string
  33. RS232I... RS-232 communications port I/O and control
  34. SECNDS... fetch the time (also see CPU)
  35. SETVM.... set video mode
  36. SPOOL.... divert output from FFPRN and WRPRN to a file (can be NUL or CON)
  37. TONE..... sound a tone
  38. UP1LIN... move the cursor up 1 line on the CRT
  39. WCGRM.... write a character in graphics mode
  40. WRPRN.... print a character string
  41. WRTTY.... write a character string on the CRT
  42. .pa
  43. NAME:     ADATE
  44. PURPOSE:  fetch the date
  45. TYPE:     subroutine (far external)
  46. SYNTAX:   CALL ADATE(MONTH,IDAY,IYEAR)
  47. OUTPUT:   MONTH (INTEGER*2) month
  48.           IDAY (INTEGER*2) day of the month
  49.           IYEAR (INTEGER*2) year 1986, 1987, etc.
  50.  
  51.  
  52. NAME:     ATIME
  53. PURPOSE:  fetch the time of day
  54. TYPE:     subroutine (far external)
  55. SYNTAX:   CALL ATIME(IHOUR,MIN,ISEC,IHUN)
  56. OUTPUT:   IHOUR (INTEGER*2) hours in military time
  57.           MIN (INTEGER*2) minutes
  58.           ISEC (INTEGER*2) seconds
  59.           IHUN (INTEGER*2) hundredths of seconds
  60.  
  61.  
  62. NAME:     BEEP
  63. PURPOSE:  beep
  64. TYPE:     subroutine (far external)
  65. SYNTAX:   CALL BEEP
  66.  
  67.  
  68. NAME:     CLEAR1
  69. PURPOSE:  clear one line on the CRT and move cursor to column 1
  70. TYPE:     subroutine (far external)
  71. SYNTAX:   CALL CLEAR1
  72.  
  73.  
  74. NAME:     CPU
  75. PURPOSE:  fetch the time
  76. TYPE:     subroutine (far external)
  77. SYNTAX:   CALL CPU(SEC)
  78. OUTPUT:   SEC (REAL*4) seconds
  79. NOTE:     on the PC this returns the elapsed time since midnight
  80.           on the HP-1000F this returns cumulative session CPU
  81.           this is useful for computing runtimes
  82.           also see SECNDS
  83.  
  84.  
  85. NAME:     CRT1C
  86. PURPOSE:  write one character to the CRT
  87. TYPE:     subroutine (far external)
  88. SYNTAX:   CALL CRT1C(IROW,ICOL,CHAR)
  89. INPUT:    IROW (INTEGER*2) row number (0=top)
  90.           ICOL (INTEGER*2) column number (0=left)
  91.           CHAR (CHARACTER*1) character
  92. OUTPUT:   none
  93.  
  94.  
  95. NAME:     CRT1D
  96. PURPOSE:  write one dot to the CRT in graphics mode
  97. TYPE:     subroutine (far external)
  98. SYNTAX:   CALL CRT1D(IROW,ICOL,IDOT)
  99. INPUT:    IROW (INTEGER*2) row number (0=top)
  100.           ICOL (INTEGER*2) column number (0=left)
  101.           IDOT (INTEGER*2) color (depends on video mode)
  102. OUTPUT:   none
  103.  
  104.  
  105. NAME:     ERASE
  106. PURPOSE:  clear the CRT
  107. TYPE:     subroutine (far external)
  108. SYNTAX:   CALL ERASE
  109.  
  110.  
  111. NAME:     EXEPRG
  112. PURPOSE:  run a program from within another program
  113. TYPE:     subroutine (far external)
  114. SYNTAX:   CALL EXEPRG('d:\path\myprog.exe'//CHAR(0),
  115.          &            'string/options etc.'//CHAR(0),IER)
  116. INPUT:    program name and runtime string
  117. OUTPUT:   IER (INTEGER*2) error indicator
  118.  
  119.  
  120. NAME:     FFPRN
  121. PURPOSE:  send a formfeed to the printer
  122. TYPE:     subroutine (far external)
  123. SYNTAX:   CALL FFPRN
  124.  
  125.  
  126. NAME:     FTIME
  127. PURPOSE:  fetch character string indicating date and time
  128. TYPE:     subroutine (far external)
  129. SYNTAX:   CALL FTIME(DATE)
  130. OUTPUT:   DATE (CHARACTER*30)
  131.  
  132.  
  133. NAME:     GET1C
  134. PURPOSE:  read 1 character from the keyboard don't wait or display
  135. TYPE:     subroutine (far external)
  136. SYNTAX:   CALL GET1C(ANS)
  137. OUTPUT:   ANS (CHARACTER*1)
  138. NOTE:     this is very handy for creating menus - also see READ1
  139.  
  140.  
  141. NAME:     GETPSP
  142. PURPOSE:  get the program segment prefix (PC only - on HP use GETST)
  143. TYPE:     subroutine (far external)
  144. SYNTAX:   CALL GETPSP(PSP)
  145. INPUT:    none
  146. OUTPUT:   PSP (CHARACTER*1 PSP(128))
  147. NOTE:     This seems like a logical thing to want; but to actually find
  148.           the PSP after DOS gets through with it on the PC is no easy
  149.           task when working from inside an EXE file.
  150.  
  151.  
  152. NAME:     HELPME
  153. PURPOSE:  detect keyboard interrupt (if-break)
  154. TYPE:     subroutine (far external)
  155. SYNTAX:   CALL HELPME(NAME,CBUF)
  156. INPUT:    NAME (CHARACTER*12) user-defined help file name
  157.           CBUF (CHARACTER*5) key
  158. OUTPUT:   output is always to the CRT via WRTTY
  159. NOTE:     The key can be '?,xxx' or just 'xxx  ' either way will do.
  160.           See example help file at the end of this section.
  161.  
  162.  
  163. NAME:     IFBRK
  164. PURPOSE:  detect keyboard interrupt (if-break)
  165. TYPE:     LOGICAL*2 function (far external)
  166. SYNTAX:   IF(IFBRK(0)) GO TO 100
  167. NOTE:     you must pass a dummy parameter "0" so FORTRAN will generate
  168.           the proper calling sequence
  169.  
  170.  
  171. NAME:     LXXX87
  172. PURPOSE:  logical test for math coprocessor
  173. TYPE:     LOGICAL*2 function (far external)
  174. SYNTAX:   IF(.NOT.LXXX87(0)) GO TO 100
  175. NOTE:     you must pass a dummy parameter "0" so FORTRAN will generate
  176.           the proper calling sequence
  177.  
  178.  
  179. NAME:     PAUSE
  180. PURPOSE:  display the message "hit the SPACE BAR to continue" and wait
  181.           for any keystroke
  182. TYPE:     subroutine (far external)
  183. SYNTAX:   CALL PAUSE
  184. NOTE:     you may want to follow this with CALL CLEAR1 to erase the line
  185.  
  186.  
  187. NAME:     PRT1C
  188. PURPOSE:  send 1 character to the printer (bypasses DOS)
  189. TYPE:     subroutine (far external)
  190. SYNTAX:   CALL PRT1C('a') or CALL PRT1C(CHAR(13))
  191. INPUT:    one CHARACTER*1 variable
  192. NOTE:     if you want to print a string use WRPRN
  193.  
  194.  
  195. NAME:     READ1
  196. PURPOSE:  read 1 character from the keyboard - don't wait for RETURN
  197. TYPE:     subroutine (far external)
  198. SYNTAX:   CALL READ1(ANS)
  199. OUTPUT:   ANS (CHARACTER*1)
  200. NOTE:     this is very handy for creating menus - also see GET1C
  201.  
  202.  
  203. NAME:     READC
  204. PURPOSE:  read a string from the keyboard
  205. TYPE:     subroutine (far external)
  206. SYNTAX:   CALL READC(CBUF,NBUF,IERR)
  207. INPUT:    NBUF (INTEGER*2) maximum number of characters to be read
  208. OUTPUT:   CBUF (CHARACTER*1 CBUF(NBUF) or CHARACTER*80 CBUF, NBUF=80)
  209.           IERR (INTEGER*2) error return indicator (IERR=0 is normal)
  210. NOTE:     This bypasses DOS (which is often advantageous). On the HP
  211.           this goes directly to the OPSYS. If you ask for 6 characters
  212.           then READC will only allow you to enter 6. The maximum number
  213.           of characters that can be requested is the 80 - the current
  214.           column (or a maximum of 79 if the cursor is at the left)
  215.  
  216.  
  217. NAME:     RRPAR
  218. PURPOSE:  get file name from runtime string
  219. TYPE:     subroutine (far external)
  220. SYNTAX:   CALL RRPAR(N,NAME)
  221. INPUT:    N (INTEGER*2) number of entry see example below
  222. OUTPUT:   NAME (CHARACTER*12)
  223. NOTE:     the purpose of this is to fetch and parse the string that you
  224.           type in after the name of your program as below
  225.  
  226.                MYPROG this.dat that.for other.bin wednesday
  227.  
  228.           fetch the names with the following
  229.  
  230.                CHARACTER NAME1*12,NAME2*12,NAME3*12,COMMENT*12
  231.                CALL RRPAR(1,NAME1)
  232.                CALL RRPAR(2,NAME2)
  233.                CALL RRPAR(3,NAME3)
  234.                CALL RRPAR(4,COMMENT)
  235.  
  236.           you will get the following
  237.  
  238.                NAME1='this.dat'
  239.                NAME2='that.for'
  240.                NAME3='other.bin'
  241.                COMMENT='wednesday'
  242.  
  243.  
  244. NAME:     RS